﻿using IM.Easy.Entity.Log;
using IM.Easy.Infrastructure.Query;
using IM.Easy.LogServices.Dtos;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IM.Easy.LogServices.IServices
{
    /// <summary>
    /// 登录注销日志
    /// </summary>
    public interface ISessionLogService
    {
        /// <summary>
        /// 添加登录日志
        /// </summary>
        /// <param name="uid"></param>
        /// <param name="userName"></param>
        /// <returns></returns>
        bool AddLoginLog(long uid, string userName);

        /// <summary>
        /// 添加注销日志
        /// </summary>
        /// <param name="log">注销日志信息</param>
        /// <returns>操作结果</returns>
        bool AddLogoutLog(long uid, string userName);

        /// <summary>
        /// 获取所有实体
        /// </summary>
        /// <returns>所有实体的列表</returns>
        PageResponse<SessionLog> GetPageList(SessionLogQueryDto query);

        /// <summary>
        /// 根据 ID 获取实体
        /// </summary>
        /// <param name="id">实体的唯一标识</param>
        /// <returns>获取的实体</returns>
        SessionLog GetById(Guid id);

        /// <summary>
        /// 更新一个已有的实体
        /// </summary>
        /// <param name="entity">更新后的实体</param>
        /// <returns>更新后的实体</returns>
        bool Update(SessionLog entity);

        /// <summary>
        /// 根据 ID 删除实体
        /// </summary>
        /// <param name="id">要删除的实体的唯一标识</param>
        /// <returns>操作是否成功</returns>
        bool Delete(params Guid[] key);
    }
}
